﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Server
{
    public static class BaseEvent
    {
        /// <summary>
        /// 打印消息 - 委托定义
        /// </summary>
        public delegate void PrintEventHandler(string meg);
        /// <summary>
        /// 打印消息 - 事件定义
        /// </summary>
        public static event PrintEventHandler PrintFormEvent;
        /// <summary>
        /// 打印消息 - 事件发起
        /// </summary>
        public static void Print(string meg)
        {
            if (PrintFormEvent != null)
                PrintFormEvent.BeginInvoke(meg,null, null);
        }



        /// <summary>
        /// 统计连接数 - 委托定义
        /// </summary>
        public delegate void ConnectionCountEventHandler(bool flag);
        /// <summary>
        /// 统计连接数 - 事件定义
        /// </summary>
        public static event ConnectionCountEventHandler ConnectionCountFormEvent;
        /// <summary>
        /// 统计连接数 - 事件发起
        /// </summary>
        public static void ConnectionCount(bool flag)
        {
            if (ConnectionCountFormEvent != null)
                ConnectionCountFormEvent.BeginInvoke(flag, null, null);
        }
    }
}
